using System;


namespace Functional
{
    public class Folds
    {
        public static T Fold<T>(T[] inputs, Func<T, T, T> foldFunction)
        {
            Int32 L;
            T lOut = inputs[0];
            for (L = 1; L < inputs.Length; L++)
            {
                lOut = foldFunction(lOut, inputs[L]);
            }
            return lOut;
        }
    }
}